// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 新增脚本 新增脚本 POST /scriptManage/addScript */
export async function addScriptUsingPost(
  body: dataFactory.AddScriptDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/scriptManage/addScript', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除脚本 通过ID删除脚本 DELETE /scriptManage/deleteScript/${param0} */
export async function deleteScriptUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.deleteScriptUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/scriptManage/deleteScript/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取脚本 通过ID获取脚本 GET /scriptManage/getScript/${param0} */
export async function getScriptUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.getScriptUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/scriptManage/getScript/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新脚本 更新脚本 PUT /scriptManage/updateScript */
export async function updateScriptUsingPut(
  body: dataFactory.UpdateScriptDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/scriptManage/updateScript', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
